home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 235 / Issue 235 - September 2007 - DPCS0907DVD.ISO / Extras / NetObjects Fusion / NOF10.exe / data1.cab / FSI / lib / nof / ListItem.js < prev    next >
Encoding:
Text File  |  2007-04-11  |  1.5 KB  |  74 lines

  1. /****i* SOURCE_FILE/INFO
  2.     *
  3.     * NAME
  4.     *  ListItem.js
  5.     *
  6.     * USAGE
  7.     *  Part of Netobjects JavaScript Library.
  8.     *
  9.     * COPYRIGHT
  10.     *  Copyright ⌐ 2000-2005 Website Pros, Inc.
  11.     *  All Rights Reserved.
  12.     *
  13.     *  This is an unpublished work protected by Website Pros, Inc.
  14.     *  as a trade secret, and is not to be used or disclosed except as
  15.     *  expressly provided in a written license agreement executed by
  16.     *  you and Website Pros, Inc.
  17.     *
  18.     *      <copyright@websitepros.com>
  19.     *
  20.     * NOTES
  21.     *  JavaScript code.
  22.     *
  23.     *****/
  24. if (!IS.isModuleInitialized("IS.NOF.ListItem"))
  25. {
  26.     /****h* NOF_JavaScript_Library/NOF.ListItem
  27.     *
  28.     * NAME
  29.     *  NOF.ListItem
  30.     *
  31.     * DESCRIPTION
  32.     *  
  33.     *    External dependencies: none
  34.     ****/
  35.     
  36.     /**
  37.     * Constructor    
  38.     * @param label
  39.     * @param values
  40.     **/
  41.     function NOF_ListItem(label, values){ 
  42.         this.__proto__ = NOF_ListItem.prototype;
  43.                 
  44.         this.label = label;
  45.         this.values = values;
  46.         
  47.     }
  48.     {        
  49.         var method = NOF_ListItem.prototype;
  50.         
  51.         method.equals = function (listItem){
  52.             return (this.label == listItem.label);
  53.         }
  54.         
  55.         method.setValues = function (vals){
  56.             for(var i=0; i<vals.length; i++){
  57.                 if(vals[i]!=null)
  58.                     this.values[i] = vals[i];                        
  59.             }            
  60.         }
  61.         
  62.         method.toString = function (){
  63.             return this.label+"__"+this.values.join("__");
  64.         }
  65.         
  66.         method.setValueAtIndex = function (index, value) {
  67.             this.values[index] = value;  
  68.         }
  69.         
  70.     }        
  71.     
  72.     NOF.__proto__.ListItem = NOF_ListItem;
  73.     
  74. }